function showImg(){
    layer.photos({
        photos: '.layui-table'
        ,anim: 5 //0-6的选择，指定弹出图片动画类型，默认随机（请注意，3.0之前的版本用shift参数）
    });
}

layui.use(['form','layer','table','laytpl','laydate'],function(){
    var form = layui.form,
        layer = parent.layer === undefined ? layui.layer : top.layer,
        $ = layui.jquery,
        laytpl = layui.laytpl,
        table = layui.table,
        laydate = layui.laydate;
    //日期范围
    laydate.render({
        elem: '#authTime'
        , range: true
    });
//日期范围
    laydate.render({
        elem: '#loginTime'
        , range: true
    });
    //客户列表
    var tableIns = table.render({
        elem: '#customerList',
        url : '../customer/getCustomerList',
        cellMinWidth : 95,
        page : true,
        height : "full-125",
        loading:true,
        id : "customerListTable",
        cols : [[
            {field: 'nickName', title: '微信名称', align:"center"},
            {field: 'nickImg', title: '微信头像', align:'center',templet: function(d) {
                    return "<img src='"+d.nickImg+"' onclick='showImg()' class='insImg' width='50px' height='50px' />"
                }},
            {field: 'code', title: 'openId', align:'center'},
            {field: 'authTime', title: '授权时间', align:'center'},
            {field: 'loginTime', title: '最近一次登录时间', align:'center'},
        ]]
    });

    //搜索【此功能需要后台配合，所以暂时没有动态效果演示】
    $(".search_btn").on("click",function(){
        console.log($(".userName").val())
        tableIns.reload({
            page: {
                curr: 1 //重新从第 1 页开始
            },
            where: { //设定异步数据接口的额外参数，任意设
                nickName:$(".nickName").val(),
                authTime:$("#authTime").val(),
                loginTime:$("#loginTime").val(),
            }
        })
    });

//列表操作
    table.on('tool(customerList)', function (obj) {
        var layEvent = obj.event,
            //当前行数据
            data = obj.data;
    });
});